package Pojo;

import java.util.Objects;

//子菜单实体类
public class MenuChild {
    private Integer menu_child_id;//子菜单id（主键）
    private String menu_child_name;//子菜单名称
    private Integer menu_id;//主菜单id（主菜单表主键）
    private String menu_child_url;//子菜单跳转链接(JSP文件路径)

    //下面的属性用于mybatis表关系查询，一对一，一对多，多对多
    //ps:根据代码需求可以自行添加
    private Menu menu;//主菜单实体类对象


    public MenuChild() {
    }

    public MenuChild(Integer menu_child_id, String menu_child_name, Integer menu_id, String menu_child_url, Menu menu) {
        this.menu_child_id = menu_child_id;
        this.menu_child_name = menu_child_name;
        this.menu_id = menu_id;
        this.menu_child_url = menu_child_url;
        this.menu = menu;
    }

    @Override
    public String toString() {
        return "MenuChild{" +
                "menu_child_id=" + menu_child_id +
                ", menu_child_name='" + menu_child_name + '\'' +
                ", menu_id=" + menu_id +
                ", menu_child_url='" + menu_child_url + '\'' +
                ", menu=" + menu +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MenuChild menuChild = (MenuChild) o;
        return Objects.equals(menu_child_id, menuChild.menu_child_id) &&
                Objects.equals(menu_child_name, menuChild.menu_child_name) &&
                Objects.equals(menu_id, menuChild.menu_id) &&
                Objects.equals(menu_child_url, menuChild.menu_child_url) &&
                Objects.equals(menu, menuChild.menu);
    }

    @Override
    public int hashCode() {
        return Objects.hash(menu_child_id, menu_child_name, menu_id, menu_child_url, menu);
    }

    public Integer getMenu_child_id() {
        return menu_child_id;
    }

    public void setMenu_child_id(Integer menu_child_id) {
        this.menu_child_id = menu_child_id;
    }

    public String getMenu_child_name() {
        return menu_child_name;
    }

    public void setMenu_child_name(String menu_child_name) {
        this.menu_child_name = menu_child_name;
    }

    public Integer getMenu_id() {
        return menu_id;
    }

    public void setMenu_id(Integer menu_id) {
        this.menu_id = menu_id;
    }

    public String getMenu_child_url() {
        return menu_child_url;
    }

    public void setMenu_child_url(String menu_child_url) {
        this.menu_child_url = menu_child_url;
    }

    public Menu getMenu() {
        return menu;
    }

    public void setMenu(Menu menu) {
        this.menu = menu;
    }
}
